﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace class2
{//2、有一款叫做“切水果”的游戏，里面有各种各样的水果，
//A、现在请定义一个叫做“Fruit”的枚举类型，里面有：香蕉、苹果、西瓜、草莓、葡萄、哈密瓜、奇异果。
//B、然后定义一个输出水果分数的方法，参数类型就是这个水果枚举，方法中根据不同的枚举值，输出水果对应的分数（可以参考切水果游戏）。注：水果形状越小，切到的时候分数就越高。
        enum Fruit
    {
        葡萄=1,
        草莓,
        奇异果,
        苹果,
        香蕉,
        哈密瓜,
        西瓜
    }
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("这里是切水果游戏，开始游戏！");
            
            while (true)
            {
                Console.WriteLine("请选择：1，葡萄  2,草莓  3,奇异果  4,苹果  5,香蕉  6，,哈密瓜  7,西瓜");
                int key = int.Parse(Console.ReadLine());
                switch (key)
                {
                    case 1:
                        Fruit pu = Fruit.葡萄;
                        int p = (int)pu;
                        Console.WriteLine("你切的水果是："+(int)pu +","+Fruit.葡萄);
                        Console.WriteLine("你的分数为：70");
                        break;

                    case 2:
                        Fruit cao = Fruit.草莓;
                        int c = (int)cao;
                        Console.WriteLine("你切的水果是：" + (int)cao + "," + Fruit.草莓);
                        Console.WriteLine("你的分数为：60");
                        break;

                    case 3:
                        Fruit qi = Fruit.奇异果;
                        int q = (int)qi;
                        Console.WriteLine("你切的水果是：" + (int)qi + "," + Fruit.奇异果);
                        Console.WriteLine("你的分数为：50");
                        break;

                    case 4:
                        Fruit pin = Fruit.苹果;
                        int pi = (int)pin;
                        Console.WriteLine("你切的水果是：" + (int)pin + "," + Fruit.苹果);
                        Console.WriteLine("你的分数为：40");
                        break;

                    case 5:
                        Fruit xiang = Fruit.香蕉;
                        int x = (int)xiang;
                        Console.WriteLine("你切的水果是：" + (int)xiang + "," + Fruit.香蕉);
                        Console.WriteLine("你的分数为：30");
                        break;

                    case 6:
                        Fruit ha = Fruit.哈密瓜;
                        int h = (int)ha;
                        Console.WriteLine("你切的水果是：" + (int)ha + "," + Fruit.哈密瓜);
                        Console.WriteLine("你的分数为：20");
                        break;

                    case 7:
                        Fruit xi = Fruit.西瓜;
                        int i = (int)xi;
                        Console.WriteLine("你切的水果是：" + (int)xi + "," + Fruit.西瓜);
                        Console.WriteLine("你的分数为：10");
                        break;
                }
                Console.ReadLine();
            }
        }
    }
}
